package br.com.colegio.vo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.Persistent;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import br.com.colegio.dao.BoletoDAO;

import com.google.appengine.api.datastore.Key;

@Entity
public class BoletoStatus implements Serializable
{
	private static final long serialVersionUID = 1644348376859410218L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Key key;

	@Persistent
	private String codigo;

	@Persistent
	private String descricao;

	public long getId() {
		return key.getId();
	}

	public void setId(long id) {
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public String getCodigo() {
		return codigo;
	}

	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public Set<Boleto> getBoletos() {
		return new HashSet(BoletoDAO.getByStatus(getId()));
	}
}
